Issue #1633 - Ensure focus on click
authorMickael Istria <mistria@redhat.com>
Fri, 1 Feb 2019 10:08:43 +0000 (10:08 +0000)
committerMickael Istria <mistria@redhat.com>
Mon, 4 Feb 2019 16:46:09 +0000 (17:46 +0100)
This is necessary to give back focus to the Broadway elements when
content is embedded in an IFrame.

Signed-off-by: Mickael Istria <mistria@redhat.com>
gdk/broadway/client.html

index 42b5c45f01ce984b8fcca44e06c5b450fcff3fd5..a2954c1f316abd38517e2ea5ad7e2ba82330e189 100644 (file)
@@ -10,6 +10,6 @@ body { overflow: hidden; }
 <script type="text/javascript" src="broadway.js"></script>
 </head>
 
-<body onload="connect()">
+<body onload="connect()" onclick="if (!document.hasFocus() && window.topElement !== window.self) { window.focus(); }">
 </body>
 </html>